<include file="../Public/header" />
<style>
  #J_imgs { line-height: 3;}
</style>
<script data-main="__PUBLIC__/admin/js/page/admin/content/addad" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page">
    <div class="page-hd">
      <h1>{$Think.lang.add}{$Think.lang.ad}</h1>
    </div>

    <div class="form">
      <form method="post" id="J_form" action="{:URL('admin/Content/createAd')}" enctype="multipart/form-data">
        <input type="hidden" id="A_typeId" value="{$typeId}">
        <dl class="kv">
          <dt>
            <label>{$Think.lang.title}：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="title" id="title" type="text" value="{$title}" style="width: 400px" required>
            <span class="required">*</span>
            <div class="kv-error"></div>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>{$Think.lang.place}：</label>
          </dt>
          <dd>
            <select name="place">
              <php>if(!in_array($place,array(0,1,2,3,4,5))) $place = 0;</php>
              <option value="0" <eq name="place" value="0">selected</eq>>{$Think.lang.middle}
              </option>
              <option value="1" <eq name="place" value="1">selected</eq>
                >{$Think.lang.head}
              </option>
              <option value="4" <eq name="place" value="4">selected</eq>
                >{$Think.lang.bottom}
              </option>
              <option value="2" <eq name="place" value="2">selected</eq>
                >{$Think.lang.leftDown}
              </option>
              <option value="3" <eq name="place" value="3">selected</eq>
                >{$Think.lang.rightDown}
              </option>
              <option value="5" <eq name="place" value="5">selected</eq>
                >{$Think.lang.rightUp}
              </option>
            </select>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>{$Think.lang.isActive}：</label>
          </dt>
          <dd>
            <label>
              <input type="radio" name="is_active" value="0" <neq name="is_active" value="1">checked</neq>
              >否</label>
            <label>
              <input type="radio" name="is_active" value="1" <eq name="is_active" value="1">checked</eq>
              >是</label>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>{$Think.lang.adDisplayType}：</label>
          </dt>
          <dd>
              <div id="J_type">
                <label>
                  <input type="radio" name="display_type" value="1" checked>html</label>
                <label>
                  <input type="radio" name="display_type" value="2">{$Think.lang.code}</label>
              </div>
              <div class="tab-content">
                <div class="tab-pane active">
                  <textarea name="content" id="html_editor" style="width: 680px; height: 200px"></textarea>
                </div>
                <div class="tab-pane">
                  <textarea name="content" id="code_editor" style="width: 680px; height: 200px"></textarea>
                </div>
                <div class="tab-pane">
                  <ul id="J_imgs">
                    <li>
                      {$Think.lang.bannerPicture}：<input type="file" name="banner[]" value="" />
                      {$Think.lang.linkAddress}：<input type="text" name="bannerUrl[]" value="" class="input-text" />
                      <a href="javascript:;" class="A_add">{$Think.lang.add}</a>
                    </li>
                  </ul>
                  <script id="tpl_item" type="text/template">
                    <li>
                      {$Think.lang.bannerPicture}：<input type="file" name="banner[]" value="" />
                      {$Think.lang.linkAddress}：<input type="text"  name="bannerUrl[]" value="" class="input-text" />
                      <a href="javascript:;" class="A_del">{$Think.lang.delete}</a>
                    </li>
                  </script>
                </div>
              </div>
          </dd>
        </dl>
        <div class="actions">
          <input class="btn btn-y" type="submit" value="{$Think.lang.OK}" />
          <a href="javascript:location.href='{:URL('admin/Content/ad')}'" class="btn btn-n">{$Think.lang.return}</a>
        </div>
      </form>
    </div>
  </div>
</body>

</html>
